
//求和相关的配置
export default {
  namespaced: true,
  actions: {
    jiaOdd(context, value) {
      if (context.sum % 2) {
        context.sum += value;
      }
    },
    jiaWait(context, value) {
      setTimeout(() => {
        context.sum += value;
      }, 500);
    },
  },
  mutations: {
    JIA: function(state, value) {
      console.log('mutations被调用了', state, value);
      state.sum += value
    },
    JIAN(state, value) {
      state.sum -= value
    },
  },
  state: {
    sum: 0,
    school: '尚硅谷',
    subject: '前端',
  },
  getters: {
    bigSum(store) {
      return store.sum * 10
    }
  }
}